package com.lemontree.web.controller;

import org.apache.log4j.Logger;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by YLBG-YCY-1325 on 2017/3/9.
 */
public class BaseController {
    protected static final String RES_CODE = "resCode";
    protected static final String RES_MSG = "resMsg";
    protected final static Logger LOG = Logger.getLogger(BaseController.class);

    /**
     * 根据key值获取session
     * @param request 请求信息
     * @param key 键值
     * @return 存储的值
     */
    public Object getV2Session(HttpServletRequest request, String key) {
        return request.getSession().getAttribute(key);
    }

    /***
     * 添加值到的session中
     * @param request
     * @param key
     * @param object
     */
    public void setV2Session(HttpServletRequest request, String key, Object object) {
        request.getSession().setAttribute(key, object);
    }

}
